// 宽搜
#include <bits/stdc++.h>
using namespace std;
char tu[1005][1005];
int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, -1, 1};
char label[4] = {'v', '^', '>', '<'};

queue<pair<int, int>> Q;

int main() {
  int H, W;
  cin >> H >> W;
  for (int i = 1; i <= H; i++) {
    for (int j = 1; j <= W; j++) {
      cin >> tu[i][j];
      if (tu[i][j] == 'E') {
        Q.push({i, j});
      }
    }
  }
  while (!Q.empty()) {
    int x = Q.front().first;
    int y = Q.front().second;
    Q.pop();
    for (int d = 0; d < 4; d++) {
      int nx = x + dx[d];
      int ny = y + dy[d];
      if (nx < 1 || nx > H || ny < 1 || ny > W) {
        continue;
      }
      if (tu[nx][ny] == '.') {
        tu[nx][ny] = label[d];
        Q.push({nx, ny});
      }
    }
  }
  for (int i = 1; i <= H; i++) {
    for (int j = 1; j <= W; j++) {
      cout << tu[i][j];
    }
    cout << endl;
  }

  return 0;
}